/**
 * meiguang8.com
 * Copyright (C) 2016-2019 All Rights Reserved.
 */
package com.yuanchuang.yp.mall.web.admin.user.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.List;

/**
 * class_name: TreeMenuModel
 * package: com.yuanchuang.yp.mall.web.admin.user.model
 * describe: TODO
 * @author: yuanyuan.zhu
 * creat_date: 2019/7/16
 * creat_time: 10:37
 **/
@Data
public class TreeMenuModel implements Serializable {

    private Long menuId;

    private String path;

    private String component;
    private TreeMenuMeta meta;
    private String name;
    private Integer parentId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<TreeMenuModel> children;
    private Boolean isCheck;

    private Boolean hidden;

    @Data
    public static class TreeMenuMeta implements Serializable {
        private String title;
        private String icon;
        private String noCache;

        @Override
        public String toString() {
            return ReflectionToStringBuilder.reflectionToString(this,
                    ToStringStyle.SHORT_PREFIX_STYLE);
        }
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.reflectionToString(this,
                ToStringStyle.SHORT_PREFIX_STYLE);
    }
}
